home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / rss / exists.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  636 b   |  27 lines

  1. /*
  2.                                 E X I S T S . C
  3. \funcref{exists}                          % name
  4.     {int  \fname (\params)}            % type
  5.     {{char $*$}{name}{pathname}}                              % args
  6.     {1: the file exists,\\
  7.      0: the file doesn't exist}
  8.     {}
  9.     {}
  10.     {exists.c}                              % sourcefile
  11.     {                               %description
  12.         The function returns 1 if the filename given as its argument exists.
  13.         Otherwise, 0 is returned.
  14.     }
  15. */
  16.  
  17. #include "icrssdef.h"
  18.  
  19. int exists(name)
  20.     char *name;
  21. {
  22.     struct stat
  23.         buf;
  24.  
  25.     return(!stat(name, &buf));
  26. }
  27.